// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.iso.sprite;

import org.lwjgl.opengl.ARBShaderObjects;
import zombie.core.opengl.Shader;
import zombie.core.opengl.ShaderProgram;
import zombie.core.textures.TextureDraw;

final class SkyBoxShader extends Shader {
    private int SkyBoxTime;
    private int SkyBoxParamCloudCount;
    private int SkyBoxParamCloudSize;
    private int SkyBoxParamSunLight;
    private int SkyBoxParamSunColor;
    private int SkyBoxParamSkyHColour;
    private int SkyBoxParamSkyLColour;
    private int SkyBoxParamCloudLight;
    private int SkyBoxParamStars;
    private int SkyBoxParamFog;
    private int SkyBoxParamWind;

    public SkyBoxShader(String string) {
        super(string);
    }

    @Override
    public void startRenderThread(TextureDraw var1) {
        SkyBox skyBox = SkyBox.getInstance();
        ARBShaderObjects.glUniform1fARB(this.SkyBoxTime, (float)skyBox.getShaderTime());
        ARBShaderObjects.glUniform1fARB(this.SkyBoxParamCloudCount, skyBox.getShaderCloudCount());
        ARBShaderObjects.glUniform1fARB(this.SkyBoxParamCloudSize, skyBox.getShaderCloudSize());
        ARBShaderObjects.glUniform3fARB(this.SkyBoxParamSunLight, skyBox.getShaderSunLight().x, skyBox.getShaderSunLight().y, skyBox.getShaderSunLight().z);
        ARBShaderObjects.glUniform3fARB(this.SkyBoxParamSunColor, skyBox.getShaderSunColor().r, skyBox.getShaderSunColor().g, skyBox.getShaderSunColor().b);
        ARBShaderObjects.glUniform3fARB(
            this.SkyBoxParamSkyHColour, skyBox.getShaderSkyHColour().r, skyBox.getShaderSkyHColour().g, skyBox.getShaderSkyHColour().b
        );
        ARBShaderObjects.glUniform3fARB(
            this.SkyBoxParamSkyLColour, skyBox.getShaderSkyLColour().r, skyBox.getShaderSkyLColour().g, skyBox.getShaderSkyLColour().b
        );
        ARBShaderObjects.glUniform1fARB(this.SkyBoxParamCloudLight, skyBox.getShaderCloudLight());
        ARBShaderObjects.glUniform1fARB(this.SkyBoxParamStars, skyBox.getShaderStars());
        ARBShaderObjects.glUniform1fARB(this.SkyBoxParamFog, skyBox.getShaderFog());
        ARBShaderObjects.glUniform3fARB(this.SkyBoxParamWind, skyBox.getShaderWind().x, skyBox.getShaderWind().y, skyBox.getShaderWind().z);
    }

    @Override
    public void onCompileSuccess(ShaderProgram var1) {
        int _int = this.getID();
        this.SkyBoxTime = ARBShaderObjects.glGetUniformLocationARB(_int, "SBTime");
        this.SkyBoxParamCloudCount = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamCloudCount");
        this.SkyBoxParamCloudSize = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamCloudSize");
        this.SkyBoxParamSunLight = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamSunLight");
        this.SkyBoxParamSunColor = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamSunColour");
        this.SkyBoxParamSkyHColour = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamSkyHColour");
        this.SkyBoxParamSkyLColour = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamSkyLColour");
        this.SkyBoxParamCloudLight = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamCloudLight");
        this.SkyBoxParamStars = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamStars");
        this.SkyBoxParamFog = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamFog");
        this.SkyBoxParamWind = ARBShaderObjects.glGetUniformLocationARB(_int, "SBParamWind");
    }
}
